SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
CREATE Procedure [dbo].[SP_TCREND_GAST_I01]
/*-------------------------------------------------------*/
/*---Empresa              : OFISIS S.A.                --*/
/*---Cliente              : OFISIS                 --*/
/*---Sistema              : Tesoreria                  --*/
/*---M¸dulo               : Empresa                    --*/
/*---Programa             : Actualizacion Tipo Operac. --*/ 
/*---                       Rendiciones Gastos         --*/
/*---Script               : tcmovi_b.sql               --*/
/*---Nombre SP            : SP_TCREND_GAST_I01         --*/
/*---Desarrollado por     : Javier Flores A.           --*/
/*---Fecha Creaci¸n       : 16/11/1999                 --*/
/*---Base Datos           : Microsoft Sql Server       --*/
/*---Versi¸n              : 7.0                        --*/
/*---Invoca a SP          :                            --*/
/*-------------------------------------------------------*/

/*-------------------------------------------------------*/
/*---Modificado 1 por     :                            --*/
/*---Fecha Modificaci¸n   :                            --*/ 
/*---Detalle Modificaci¸n :                            --*/
/*-------------------------------------------------------*/

/*-------------------------------------------------------*/
/*---Comentarios                                       --*/
/*---                                                  --*/
/*---                                                  --*/
/*-------------------------------------------------------*/

/*-------------------------------------------------------*/
/*---Drop Proc SP_TCREND_GAST_I01                      --*/
/*---Grant all on SP_TCREND_GAST_I01 to public         --*/ 
/*---SP_TCREND_GAST_I01                                --*/
/*-------------------------------------------------------*/
 @ISCO_EMPR TD_VC_002, 
 @ISCO_USUA_MODI TD_VC_008_USUA,
 @ISCO_TIPO_OPER TD_VC_003,
 @ISNU_REND_GAST TD_VC_010,
 @IDFE_REND_GAST TD_DT_001,
 @INNU_CORR TD_IN_001 
 as

 Begin Tran  SP_TCREND_GAST_I01
  
  Update TDREND_GAST
  Set  CO_TIPO_OPER = @ISCO_TIPO_OPER,
	 CO_USUA_MODI = @ISCO_USUA_MODI,
	 FE_USUA_MODI =  GETDATE()
  Where CO_EMPR = @ISCO_EMPR
  And   NU_REND_GAST = @ISNU_REND_GAST
  And   FE_REND_GAST = @IDFE_REND_GAST
  And   NU_CORR_GAST = @INNU_CORR

  If @@error <> 0
      Begin
        Rollback tran
        Return
      End

  Update TDREND_ANUL
  Set  CO_TIPO_OPER = @ISCO_TIPO_OPER,
	 CO_USUA_MODI = @ISCO_USUA_MODI,
	 FE_USUA_MODI = GETDATE()
  Where CO_EMPR = @ISCO_EMPR
  And   NU_REND_GAST = @ISNU_REND_GAST
  And   FE_REND_GAST = @IDFE_REND_GAST
  And   NU_CORR_GAST = @INNU_CORR

  If @@error <> 0
      Begin
        Rollback tran
        Return
      End

 Commit Tran

/*------------------------- Fin ------------------------------*/


GO
